Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use minimal regex/fancy-regex build features to reduce build size #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bendavis78
Copy link

When building a WASM module that uses zxcvbn-rs, I found I was able to reduce the build size by roughly 25% by setting the regex and fancy-regex package features to use only standard library support, and avoid using unicode character classes such as \s.

This PR replaces \s with \t\r\n in MAYBE_DATE_WITH_SEPARATOR_REGEX, and sets features = ["std"] on the regex and fancy-regex dependencies.

See here for more info on this optimization for the regex dependency: https://github.com/rust-lang/regex?tab=readme-ov-file#crate-features.

@shssoichiro
Copy link
Owner

Looks like there's a feature missing on one of the dependencies, that's conditionally required for wasm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants